#include <iostream>
#include <vector>
using namespace std;

template<class T> 
void printVector(const vector<T> &integer2);

int main()
{
	const int size = 6;
	int array[size] = {1, 2, 3, 4, 5, 6};
	vector<int> integerVector;
	cout << "integerVector.size() = " << integerVector.size() << "\n";
	cout << "integerVector.capacity() = " << integerVector.capacity() << "\n";
	
	integerVector.push_back(2);
	cout << "integerVector.size() = " << integerVector.size() << "\n";
	cout << "integerVector.capacity() = " << integerVector.capacity() << "\n";
	integerVector.push_back(3);
	cout << "integerVector.size() = " << integerVector.size() << "\n";
	cout << "integerVector.capacity() = " << integerVector.capacity() << "\n";
	integerVector.push_back(4);
	cout << "integerVector.size() = " << integerVector.size() << "\n";
	cout << "integerVector.capacity() = " << integerVector.capacity() << "\n"; 
	for(int *ptr=array; ptr!=(array+size); ptr++)
	{
		cout << *ptr << " ";
	}
	cout << "\nUsing iterator travel vector" << "\n";
//	std::vector<int>::const_iterator constIterator;
//	for(constIterator=integerVector.begin(); constIterator!=integerVector.end(); constIterator++)
//	{
//		cout << *constIterator << " ";
//	}
	
	printVector(integerVector);
	cout << "\nReverse contents of vector" << "\n";
	vector<int>::reverse_iterator reverseIterator;
	for(reverseIterator=integerVector.rbegin(); reverseIterator!=integerVector.rend(); reverseIterator++)
	{
		cout << *reverseIterator << " "; 
	}
	cout << "\n";
	return 0; 
	
}

template <typename T>
void printVector(const vector<T> &integer2)
{
	typename vector<T>::const_iterator constIterator;
	for(constIterator=integer2.begin(); constIterator!=integer2.end(); constIterator++)
	{
		cout << *constIterator << " ";
	}
}
